<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of proyect_requirement_claims_controller
 *
 * @author wilson
 */
class TitleStudyClaimsController extends AppController {

    //put your code here
    var $name = "TitleStudyClaims";

  
    
    
      function edit($id) {
        if (empty($this->data)) {
            
            $this->data = $this->TitleStudyClaim->find('first', array('conditions' => array('TitleStudyClaim.id' => $id),'fields'=>array('TitleStudyClaim.id','TitleStudyClaim.claim_id','TitleStudyClaim.calificacion','TitleStudyClaim.concepto')));
        } else {
            if ($this->TitleStudyClaim->saveAll($this->data)) {
                $this->Session->setFlash('Reclamacion editada con éxito');
                $this->redirect(array('controller' => 'Claims', 'action' => 'total_index', $this->data['TitleStudyClaim']['claim_id']));
            }
        }
    }
     function recalification($id) {
        if (empty($this->data)) {
            
            $this->data = $this->TitleStudyClaim->find('first', array('conditions' => array('TitleStudyClaim.id' => $id),'fields'=>array('TitleStudyClaim.id','TitleStudyClaim.claim_id','TitleStudyClaim.calificacion_territorial','TitleStudyClaim.concepto_territorial')));
        } else {
            if ($this->TitleStudyClaim->saveAll($this->data)) {
                $this->Session->setFlash('Reclamacion editada con éxito');
                $this->redirect(array('controller' => 'Claims', 'action' => 'recalification_index', $this->data['TitleStudyClaim']['claim_id']));
            }
        }
    }

    

}

?>
